#ifndef CONTROLLER_H
#define CONTROLLER_H
/*!
  * \file controller.h
  * \version 0.1
  */
#include <QObject>
#include <opencv2/opencv.hpp>
#include <mainwindow.h>
#include <image.h>
#include <imagelist.h>
#include <drawshape.h>
#include <imagedisplay.h>
#include <imagealldisplay.h>
#include <imagelistdisplay.h>
#include <selectiondisplay.h>
#include <openfile.h>
#include <QDebug>
/*!
  * \class Controller
  * \brief Create and manage objects
  * \version 0.1
  */
class Controller : public QObject
{
    Q_OBJECT
private:
    MainWindow *mainwindow;
    ImageDisplay *imageD;
    ImageAllDisplay *imageAllD;
    ImageListDisplay *imageListD;
    SelectionDisplay *selectD;
    ImageList imageList;
    int currentImg;
    QSize imageSize;
    bool loadedVideo;

public:
    /*!
      * \fn Controller();
      * \brief builder
      * \version 0.1
      */
    Controller();
    /*!
      * \fn void reloadImagesList();
      * \brief Reload images in image selector (ImageListDisplat)
      * \version 0.1
      */
    void reloadImagesList();
    bool eventFilter(QObject *obj, QEvent *event);

public slots:
    /*!
      * \fn void loadVideo();
      * \brief Take a video file
      * \version 0.1
      */
    void loadVideo();
    /*!
      * \fn void prevImg();
      * \brief Display previous image
      * \version 0.1
      */
    void prevImg();
    /*!
      * \fn void nextImg();
      * \brief Display next image
      * \version 0.1
      */
    void nextImg();
    void imageClic(int x);
    void saveImage(QString dir);
    void deleteImage();
    void loadImage();
};

#endif // CONTROLLER_H
